import 'package:flutter_deer/generated/json/base/json_convert_content.dart';
import 'package:flutter_deer/account/models/agent_user_betting_entity.dart';

AgentUserBettingParamEntity $AgentUserBettingParamEntityFromJson(Map<String, dynamic> json) {
  final AgentUserBettingParamEntity agentUserBettingParamEntity = AgentUserBettingParamEntity();
  final String? username = jsonConvert.convert<String>(json['username']);
  if (username != null) {
    agentUserBettingParamEntity.username = username;
  }
  final String? accountId = jsonConvert.convert<String>(json['accountId']);
  if (accountId != null) {
    agentUserBettingParamEntity.accountId = accountId;
  }
  return agentUserBettingParamEntity;
}

Map<String, dynamic> $AgentUserBettingParamEntityToJson(AgentUserBettingParamEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['username'] = entity.username;
  data['accountId'] = entity.accountId;
  return data;
}

AgentUserBettingSummaryPoolEntity $AgentUserBettingSummaryPoolEntityFromJson(Map<String, dynamic> json) {
  final AgentUserBettingSummaryPoolEntity agentUserBettingSummaryPoolEntity = AgentUserBettingSummaryPoolEntity();
  final double? totalWinScore = jsonConvert.convert<double>(json['totalWinScore']);
  if (totalWinScore != null) {
    agentUserBettingSummaryPoolEntity.totalWinScore = totalWinScore;
  }
  final double? totalScore = jsonConvert.convert<double>(json['totalScore']);
  if (totalScore != null) {
    agentUserBettingSummaryPoolEntity.totalScore = totalScore;
  }
  final int? totalWinTimes = jsonConvert.convert<int>(json['totalWinTimes']);
  if (totalWinTimes != null) {
    agentUserBettingSummaryPoolEntity.totalWinTimes = totalWinTimes;
  }
  final int? totalBettingTimes = jsonConvert.convert<int>(json['totalBettingTimes']);
  if (totalBettingTimes != null) {
    agentUserBettingSummaryPoolEntity.totalBettingTimes = totalBettingTimes;
  }
  final List<AgentUserBettingSummaryEntity>? list = jsonConvert.convert<List<AgentUserBettingSummaryEntity>>(json['list']);
  if (list != null) {
    agentUserBettingSummaryPoolEntity.list = list;
  }
  return agentUserBettingSummaryPoolEntity;
}

Map<String, dynamic> $AgentUserBettingSummaryPoolEntityToJson(AgentUserBettingSummaryPoolEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['totalWinScore'] = entity.totalWinScore;
  data['totalScore'] = entity.totalScore;
  data['totalWinTimes'] = entity.totalWinTimes;
  data['totalBettingTimes'] = entity.totalBettingTimes;
  data['list'] = entity.list;
  return data;
}

AgentUserBettingSummaryEntity $AgentUserBettingSummaryEntityFromJson(Map<String, dynamic> json) {
  final AgentUserBettingSummaryEntity agentUserBettingSummaryEntity = AgentUserBettingSummaryEntity();
  final String? accountId = jsonConvert.convert<String>(json['accountId']);
  if (accountId != null) {
    agentUserBettingSummaryEntity.accountId = accountId;
  }
  final String? username = jsonConvert.convert<String>(json['username']);
  if (username != null) {
    agentUserBettingSummaryEntity.username = username;
  }
  final String? userAvatar = jsonConvert.convert<String>(json['userAvatar']);
  if (userAvatar != null) {
    agentUserBettingSummaryEntity.userAvatar = userAvatar;
  }
  final String? userNickName = jsonConvert.convert<String>(json['userNickName']);
  if (userNickName != null) {
    agentUserBettingSummaryEntity.userNickName = userNickName;
  }
  final double? totalWinScore = jsonConvert.convert<double>(json['totalWinScore']);
  if (totalWinScore != null) {
    agentUserBettingSummaryEntity.totalWinScore = totalWinScore;
  }
  final double? totalBettingScore = jsonConvert.convert<double>(json['totalBettingScore']);
  if (totalBettingScore != null) {
    agentUserBettingSummaryEntity.totalBettingScore = totalBettingScore;
  }
  final int? totalWinTimes = jsonConvert.convert<int>(json['totalWinTimes']);
  if (totalWinTimes != null) {
    agentUserBettingSummaryEntity.totalWinTimes = totalWinTimes;
  }
  final int? totalBettingTimes = jsonConvert.convert<int>(json['totalBettingTimes']);
  if (totalBettingTimes != null) {
    agentUserBettingSummaryEntity.totalBettingTimes = totalBettingTimes;
  }
  final String? lastBettingTime = jsonConvert.convert<String>(json['lastBettingTime']);
  if (lastBettingTime != null) {
    agentUserBettingSummaryEntity.lastBettingTime = lastBettingTime;
  }
  final String? lastBettingTimeStr = jsonConvert.convert<String>(json['lastBettingTimeStr']);
  if (lastBettingTimeStr != null) {
    agentUserBettingSummaryEntity.lastBettingTimeStr = lastBettingTimeStr;
  }
  return agentUserBettingSummaryEntity;
}

Map<String, dynamic> $AgentUserBettingSummaryEntityToJson(AgentUserBettingSummaryEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['accountId'] = entity.accountId;
  data['username'] = entity.username;
  data['userAvatar'] = entity.userAvatar;
  data['userNickName'] = entity.userNickName;
  data['totalWinScore'] = entity.totalWinScore;
  data['totalBettingScore'] = entity.totalBettingScore;
  data['totalWinTimes'] = entity.totalWinTimes;
  data['totalBettingTimes'] = entity.totalBettingTimes;
  data['lastBettingTime'] = entity.lastBettingTime;
  data['lastBettingTimeStr'] = entity.lastBettingTimeStr;
  return data;
}